Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve codecs priority #1144

Closed
wants to merge 1 commit into from
Closed

Conversation

wusspuss
Copy link

No description provided.

Copy link
Owner

@paullouisageneau paullouisageneau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix makes perfect sense but the implementation does not work as-is. For instance, when RTP maps are added or removed with addRtpMap() or removeRtpMap() you must update the ordered payload types, otherwise descriptions created this way are broken. For consistency, you should remove the payload types that are not in the map after parsing the media description (statically-assigned codecs are not supported), and payloadTypes() should also return the ordered payload types.


private:
virtual string generateSdpLines(string_view eol) const override;

int mBas = -1;

std::map<int, RtpMap> mRtpMaps;
std::vector<string> mCodecsOrder;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should contain integers as they are payload types, and I would suggest renaming it to a more explicit mOrderedPayloadTypes:

Suggested change
std::vector<string> mCodecsOrder;
std::vector<int> mOrderedPayloadTypes;

@@ -885,7 +885,9 @@ void Description::Application::parseSdpLine(string_view line) {
Description::Media::Media(const string &sdp) : Entry(get_first_line(sdp), "", Direction::Unknown) {
string line;
std::istringstream ss(sdp);
std::getline(ss, line); // discard first line
std::getline(ss, line);
parseFirstLine(line); // save codecs order
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method parses the first line a second time, which is not ideal.

string word;
std::getline(ss, word, ' '); // audio
std::getline(ss, word, ' '); // 9
std::getline(ss, word, ' '); // UDP/TLS/RTP/SAVPF
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic here is different from the one in Entry(), meaning the behavior can be inconsistent, for instance if there are two consecutive spaces.

@paullouisageneau
Copy link
Owner

Any news on this?

@paullouisageneau
Copy link
Owner

Closing due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants